<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*   let myPro = (time) => {
              return new Promise((resolve, reject) => {
                  setTimeout(() => {
                      resolve(time)
                  }, time)
              })
          }
  
  
          async function fn() {
              let res1 = await myPro(1000)
              console.log(res1)
              let res2 = await myPro(500 + res1)
              console.log(res2)
              let res3 = await myPro(500 + res2)
              console.log(res3)
          }
          fn() */

        let myPro = (time = 500) => {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve(time)
                }, time)
            })
        }

        let p = async () => {
            let res1 = await myPro()
            console.log(res1)
            let res2 = await myPro(res1 + 500)
            console.log(res2)
            let res3 = await myPro(res2 + 500)
            console.log(res3)
        }
        p()
    </script>
</body>

</html>